#ifndef _HARM_CHAR_H_
#define _HARM_CHAR_H_
#include <list>
class HarmChar_Data
{
public://private:
	float x,y;
	float h;
	float addh;
	float time;
	char v[16];
public:
	bool gogo;

	HarmChar_Data(int _v,float _x,float _y)
	{
		sprintf_s (v, 16, "%d", _v) ;
		//strcpy_s (v, 16, "-1") ;
		time=0.3f;
		x=_x;y=_y+h;
		h=-30.0;
		addh=2;
		gogo=true;
	}
	void setXY(float _x,float _y)
	{
	 x=_x;y=_y+h;
	 h=h-addh;
	}
	void HCDtime(float _time)
	{
		time-=_time;
	}
	bool TimeEnd()
	{
		if(time<=0.0)
			return true;

		return false;
	}
	void draw(HDC hdc)
	{
		TextOutA (hdc, (int)x, (int)y, v, strlen (v)) ;
	}
};
class HarmChar
{
	
public://private:
	typedef std::list<HarmChar_Data> V_HC;
	V_HC vHc;
public:
	
	void addHarmChar(int _v,float _x,float _y)
	{
		HarmChar_Data HCD(_v,_x,_y);
		vHc.push_back(HCD);		
	}

	void work(float _x,float _y)
	{
		V_HC::iterator hc = vHc.begin();
		while(hc != vHc.end())
		{
			hc->HCDtime(1.0f/30.0f);
			if(hc->TimeEnd())
			{
				hc = vHc.erase (hc) ;
				return;
			}

			hc->setXY(_x,_y);
			hc++;
		}

	}

	void HC_draw (HDC hdc)
	{
		V_HC::iterator hc = vHc.begin();
		while(hc != vHc.end())
		{
			hc->draw(hdc);
			hc++;
		}
		
	}


};

#endif